Compile the tree on a pull request, with warnings as errors (#15) - #183
Merged
Conversation
Nothing compiled this repository on a pull request. The checks here read documents, workflows, shell and the dependency graph, and none of them asked whether the code builds at all. The check-run name is exactly build, on both the workflow and the job, which is the string #26 will require on main. GitHub takes that name from the job's name and falls back to the job id, and a ruleset matches the literal, so having the two agree means a rename cannot detach the requirement from the thing it was requiring without being visible in this file. The job carries no if: and no path filter, and that is deliberate rather than omitted. GitHub creates a check run for a job it started and then skipped, with the same name a job that did the work would carry, so the cheapest thing that satisfies a name appearing in that list is a workflow that compiles nothing. This one runs on every pull request and on every push to main, and prints the compiler it used beside its verdict. The command it runs is the one README.md gives a contributor rather than a variant of it, which is #13's third condition. Warnings are errors, set on the job rather than on the step so that a second step added later cannot quietly compile without it. That direction was proven before this landed, with an unused import and the same command: RUSTFLAGS="-D warnings" cargo build --locked --all-targets error: unused import: `std::collections::HashMap` --> src\lib.rs:51:5 = note: `-D unused-imports` implied by `-D warnings` error: could not compile `flowfin-core` (lib) due to 1 previous error and green again with the import removed. The same proof on the runner follows in this branch, because a direction proven on one machine is not the direction the gate has. The concurrency group is namespaced on the workflow name rather than being the bare word. A group string two workflows share means the run created second cancels the other, and the gate that dies that way leaves a green tick beside no verdict. This board paid for that once already, on #178. Signed-off-by: Nils Lehnen <30603423+iderex@users.noreply.github.com>
The commit after this one takes the import out again. A guard nobody watched fail is a guard nobody knows the direction of, and the direction was proven on this machine before the workflow was written rather than only here. Signed-off-by: Nils Lehnen <30603423+iderex@users.noreply.github.com>
The commit before this one added an unused import so that the build check could be watched refusing it. The run it produced is on this pull request, and this commit restores the tree it was measured against. Signed-off-by: Nils Lehnen <30603423+iderex@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The issue this belongs to
Closes #15
It also carries the third done-condition of #13, which is that the gate workflows
added in this milestone invoke the same two commands
README.mdgives acontributor rather than variants of them. This is the first such workflow. #13 is
named rather than closed here and closes on its own once this lands.
What changed
One workflow file. Its check-run name is exactly
build, on both the workflowand the job, and it runs
cargo build --locked --all-targetswith every warningan error, on every pull request against every branch and on every push to
main.The means, and why it fits
A workflow file, because the thing being added is a check GitHub runs and there
is no other way to declare one. The logic inside it is a single command from
README.mdrather than a shell block, so there is nothing here that owes afixture of its own; where this board puts logic in shell it puts it in a script
with its own fixtures, and this change deliberately has none to put there.
What failure it prevents
Nothing compiled this repository on a pull request. The checks here read
documents, workflows, shell and the dependency graph, and none of them asked
whether the code builds at all. A tree that does not compile could land.
The second one is narrower and is the reason the job carries no
if:and no pathfilter. GitHub creates a check run for a job it started and then skipped, and it
carries the job's name exactly as a job that did the work would, so the cheapest
thing satisfying "the name appears in that list" is a workflow that compiles
nothing. The comment on #15 measured that shape on a live repository before this
was written.
Evidence
The check-run names on the default branch before this, which is the state #15
describes:
There is no
buildamong them. That listing has grown by one since the comment on#15 quoted it, and the addition is the shell analysis rather than anything that
compiles.
What a guard here refuses, and the proof it bites
It refuses a compiler warning, and the direction was proven twice: once on this
machine before the workflow was written, and once on the runner, because a
direction proven on one machine is not the direction the gate has.
On this machine, an unused import and the exact command the workflow runs:
and green again with the import removed:
On the runner, the same import pushed to this branch as its own commit, with the
commit after it taking it out again. The two proof commits cancel, so what this
pull request changes against
mainis the workflow file alone:The green run before the warning, run 32811357035, which is also the evidence that
the job compiles rather than being a name in a list:
The red run with the warning in it, run 32811533858:
and the run on the head of this branch, with the import taken out, is green again
in the check list on this pull request.
What this does not cover
Only the build. Whether the tests pass is #16 and is a different check name; a
green
buildsays the tree compiles and says nothing about a test.Only this runner and this operating system. Which target triples the gate covers
is #113, and nothing here cross-compiles.
The toolchain is the runner image's, because #14 has not pinned one. The job
prints
rustc -vVandcargo --versionon every run so that which compilerproduced a verdict is in the log, but the version can move under this check
without anything here noticing, and that is exactly what #14 is for.
The name is not required on
main. #26 is what writes the required names intothe ruleset, and until it does, a red
buildblocks no merge:Who has read it
Nobody but me. There is no second reader on this board tonight, and the evidence
above stands in place of one.